Conversation
07bdad5 to
424ebe6
Compare
424ebe6 to
a763262
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a763262198
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| selectionLayer.value.style.pointerEvents = 'none'; | ||
| const pageNumber = getPdfPageNumberFromEvent(e); | ||
| selectionLayer.value.style.pointerEvents = 'auto'; | ||
| if (!pageNumber) return; |
There was a problem hiding this comment.
Clear drag mode when pointer isn't over a PDF page
When a drag starts in whitespace/margins (no .pdf-page under the pointer), this early return exits after drag mode was enabled and pointer events were turned on for the selection layer. The subsequent mouseup path bails out on !selectionPosition and does not restore the layer state, so the overlay can keep intercepting clicks and block normal document interaction until another successful selection occurs.
Useful? React with 👍 / 👎.
| const layerBounds = selectionLayer.value.getBoundingClientRect(); | ||
| const zoom = activeZoom.value / 100; | ||
| const x = (e.clientX - layerBounds.left) / zoom; | ||
| const y = (e.clientY - layerBounds.top) / zoom; | ||
| updateSelection({ startX: x, startY: y, page: pageNumber }); |
There was a problem hiding this comment.
Measure PDF drag selection in page-local coordinates
These bounds are computed relative to the global selection layer, but the selection is now tagged with a concrete page number. Downstream comment positioning adds that page container's offset (comments-store via selection.getContainerLocation(...)), so page offsets are effectively added twice on page 2+ and comments/highlights are placed far from the user's dragged area.
Useful? React with 👍 / 👎.
| const pages = json?.pages || {}; | ||
| Object.keys(pages).forEach((key) => { | ||
| const parsedIndex = Number(key); | ||
| const pageIndex = Number.isNaN(parsedIndex) ? key : parsedIndex; | ||
| const page = this.#createPage(pageIndex); |
There was a problem hiding this comment.
Load exported page-size metadata during whiteboard import
getWhiteboardData() exports meta.pageSizes, but setWhiteboardData() only replays pages and discards that metadata. Importing annotations created at a different zoom/page size therefore loses the source dimensions needed to map coordinates correctly, which causes misplaced whiteboard content after import in common cross-session/cross-device workflows.
Useful? React with 👍 / 👎.
Linear: SD-1686, SD-1687.
Core classes and functionality:
packages/superdoc/src/core/whiteboardComponents and UI logic:
packages/superdoc/src/components/WhiteboardFeatures: